package vista;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JTextField;
import javax.swing.AbstractListModel;
import javax.swing.border.LineBorder;

import java.awt.Color;

import javax.swing.JButton;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;


public class VentanaHistoria extends JFrame {

	private JPanel contentPane;
	private JTextField textField;
	private JTextField textField_1;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					VentanaHistoria frame = new VentanaHistoria();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public VentanaHistoria() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 750, 480);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JLabel lblHistoriaMedica = new JLabel("Historia Medica");
		lblHistoriaMedica.setBounds(10, 11, 113, 14);
		contentPane.add(lblHistoriaMedica);
		
		JLabel lblCedulaDePaciente = new JLabel("Cedula de Paciente:");
		lblCedulaDePaciente.setBounds(10, 36, 128, 14);
		contentPane.add(lblCedulaDePaciente);
		
		JLabel lblNombreDePaciente = new JLabel("Nombre de Paciente:");
		lblNombreDePaciente.setBounds(10, 61, 113, 14);
		contentPane.add(lblNombreDePaciente);
		
		JList list = new JList();
		list.setBorder(new LineBorder(new Color(0, 0, 0), 2));
		list.setModel(new AbstractListModel() {
			String[] values = new String[] {"Antecedentes Familiares:", "Antecedentes Personales:", "Registro de Consultas:", "Registro de Intervenciones:"};
			public int getSize() {
				return values.length;
			}
			public Object getElementAt(int index) {
				return values[index];
			}
		});
		list.setBounds(70, 107, 599, 256);
		contentPane.add(list);
		
		textField = new JTextField();
		textField.setEnabled(false);
		textField.setBounds(140, 33, 113, 20);
		contentPane.add(textField);
		textField.setColumns(10);
		
		textField_1 = new JTextField();
		textField_1.setEnabled(false);
		textField_1.setBounds(140, 61, 113, 20);
		contentPane.add(textField_1);
		textField_1.setColumns(10);
		
		JButton btnLimpiar = new JButton("Limpiar");
		btnLimpiar.setBounds(366, 374, 89, 23);
		contentPane.add(btnLimpiar);
		
		JButton btnAtras = new JButton("Atras");
		btnAtras.addMouseListener(new MouseAdapter() {
			@Override
			public void mousePressed(MouseEvent arg0) {
				RegistroPaciente obj=new RegistroPaciente();
				obj.setVisible(true);
				dispose();
			}
		});
		btnAtras.setBounds(478, 374, 89, 23);
		contentPane.add(btnAtras);
	}
}
